package com.chenwut.test1;

import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            int n = scanner.nextInt();
            String rank = scanner.next();
            int score = n;
            int x = countDistinctChars(rank);
            System.out.println(score+x);
           // System.out.println(countDistinctChars(rank));
        }
    }


    public static int countDistinctChars(String s) {
        boolean[] seen = new boolean[26];
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (!seen[c - 'A']) {
                seen[c - 'A'] = true;
                count++;
            }
        }
        return count;
    }
}